package cwb1;

import java.util.Map;
import java.util.List;
import java.util.ArrayList;

public class DivisionFactory {
	public static final long COURSE = 1;
	public static final long SUBDIVISION = 2;
	
	private DivisionFactory() {
		
	}
	
	public static Division createDivision(Map<String, Object> properties) {
		Division division = null;
		if(properties.get("divisionType").equals(COURSE)) {
			division = new Course(properties);
		}
		
		else if(properties.get("divisionType").equals(SUBDIVISION)) {
			division = new Subdivision(properties);
		}
		
		return division;
	}
	
}
